//
//  LanguageExtensions.h
//  Prism
//
//  Created by Bas du Pre on 19-05-11.
//  Copyright 2011 UU. All rights reserved.
//

#pragma once

/*
 #define Property(type, name) private type _ ## name; \
                             public type name() { return _ ## name; }\
                             public void get
*/

#define foreach_STL(var, container) \
for(typeof((container).begin()) var = (container).begin(); \
var != (container).end(); \
++var)

#define foreach(var, container) \
if (container.length() > 0) \
for(var = container[0]; unsigned int FOREACH_COUNTER = 0;\
FOREACH_COUNTER < container.length() && ((var = container[FOREACH_COUNTER]) || 1); \
++FOREACH_COUNTER)

#define PRISM_MIN(X,Y) (((X) > (Y)) ? (X) : (Y))
#define PRISM_MAX(X,Y) (((X) < (Y)) ? (X) : (Y))

#define PRISM_MIN3(X,Y,Z) (PRISM_MIN(X,Y) < (Z) ? PRISM_MIN(X,Y) : (Z))
#define PRISM_MAX3(X,Y,Z) (PRISM_MAX(X,Y) > (Z) ? PRISM_MAX(X,Y) : (Z))
